{include file="public/header" /}
</head>
<body>
<form class="layui-form layui-form-pane" action="" style="padding: 20px;">
    <input type="hidden" name="group_id" value="{$group_id|default=0}">
    <fieldset class="layui-elem-field">
        <legend> 网站列表 </legend>
        <div class="layui-field-box" style="overflow: hidden;padding: 20px;">
            {notempty name="userList"}
            {volist name="userList" id="vo"}
            <div style="width: 50%;float: left;margin-bottom: 10px;">
                <input type="checkbox" name="substations[]" title="{$vo.substation_name}" value="{$vo.substation_id}" lay-skin="primary" {if condition="strpos($substations,'['.$vo['substation_id'].']') !== false"}checked{/if}>
            </div>
            {/volist}
            {/notempty}
        </div>
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" type="button" lay-submit lay-filter="formDemo">立即提交</button>
        </div>
    </div>
</form>
</body>
<script>
    layui.use('form', function(){
        var form = layui.form;
        form.render();
        //监听提交
        form.on('submit(formDemo)', function(data){
            post_sub("{:url('Admins/setSubstationGroup')}",data.field);
            return false;
        });
    });
</script>
</html>